<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<!-- modified by wcd 2014-07-25 [E7 to E8] -->
<%@ include file="/hrm/header.jsp" %>
<%
	String fromDate = strUtil.vString(request.getParameter("fromDate"));
	String toDate = strUtil.vString(request.getParameter("toDate"));
	int subCompanyId = strUtil.parseToInt(request.getParameter("subCompanyId"),0);
	int departmentId = strUtil.parseToInt(request.getParameter("departmentId"),0);
	String resourceId = strUtil.vString(request.getParameter("resourceId"));

	//非考勤管理员只能看到自己的记录
	if(!HrmUserVarify.checkUserRight("BohaiInsuranceScheduleReport:View", user)){
		resourceId = String.valueOf(user.getUID());
	}

	String imagefilename = "/images/hdReport_wev8.gif", needfav = "1", needhelp = "";
	String titlename = SystemEnv.getHtmlLabelName(179,user.getLanguage())+"："+SystemEnv.getHtmlLabelName(16559,user.getLanguage())+"—"+SystemEnv.getHtmlLabelName(20093,user.getLanguage());
	String isDialog = Util.null2String(request.getParameter("isdialog"));
%>
<html>
	<head>
		<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
		<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
		<script type="text/javascript">

			function dataOk(){
				//  alert();
				$.ajaxSetup({
					async: false
				});
				
				var result = document.evaluate("//*[@id='_xTable']/div[1]/div[2]/table/tbody/tr/td[8]", document, null, XPathResult.ANY_TYPE, null);
				// $(result).html("点击查看请假事由");
				var nodes = result.iterateNext(); //枚举第一个元素
				var nodelist = [];
				while (nodes){
					//赋值点击显示请假事由
					//$(nodes).html("点击查看请假事由");
					//绑定点击事件
					nodes.onclick = function(){
						//获取其姓名、开始时间、结束时间
						var jssj = $(this).prev().prev().prev().html();//结束时间
						var kssj = $(this).prev().prev().prev().prev().html();//开始时间
						var sqr =  $(this).prev().prev().prev().prev().prev().html();//申请人
						// var sqr =$.cookie("loginidweaver");
						var sy = "";
						//发送ajax请求获取请假事由
						$.get("/interface/haozhi/ReasonForLeave.jsp?type=4&id="+sqr+"&startTime="+kssj+"&endTime="+jssj,function(data){
							sy = data;
						},"text");
						if(""!=sy){
							$(this).html(sy)
						}

					};
					nodelist.push(nodes);
					// 对 nodes 执行操作;
					nodes=result.iterateNext(); //枚举下一个元素
				}
				//浮动显示tag
				$(nodelist).click();
				// $(nodelist).attr("tooltips",this.value);
				$(nodelist).each(function() {
					$(this).attr("title",$(this).html());
				});
			
			};





			var dialog = parent.parent.getDialog(parent);
			
			function exportExcel(){
				document.getElementById("excels").src = "HrmScheduleDiffReportExcel.jsp?cmd=HrmScheduleDiffEvectionDetail&tnum=20093&fromDate=<%=fromDate%>&toDate=<%=toDate%>&resourceId=<%=resourceId%>&departmentId=<%=departmentId%>&subCompanyId=<%=subCompanyId%>";
			}
		</script>
	</head>
	<body>
		<%if("1".equals(isDialog)){ %>
			<div class="zDialog_div_content">
		<%} %>
		<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
		<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
		<%
			TopMenu topMenu = new TopMenu(out, user);
			topMenu.add(SystemEnv.getHtmlLabelName(28343,user.getLanguage()), "exportExcel()");
			RCMenu += topMenu.getRightMenus();
			RCMenuHeight += RCMenuHeightStep * topMenu.size();
			topMenu.showTable();
			
			String dataParam = "fromDate:"+fromDate+"+toDate:"+toDate+"+subCompanyId:"+subCompanyId+"+departmentId:"+departmentId+"+resourceId:"+resourceId+"+type:1";
			SplitPageTagTable table = new SplitPageTagTable("HrmScheduleDiffEvectionDetail", out, user);
			table.setData("weaver.hrm.report.schedulediff.HrmScheduleDiffOtherManager.getScheduleList", dataParam);
			table.addCol("15%", SystemEnv.getHtmlLabelName(124,user.getLanguage()), "departmentName");
			table.addCol("10%", SystemEnv.getHtmlLabelName(413,user.getLanguage()), "resourceName");
			table.addCol("10%", SystemEnv.getHtmlLabelName(742,user.getLanguage()), "startTime");
			table.addCol("10%", SystemEnv.getHtmlLabelName(743,user.getLanguage()), "endTime");
			table.addCol("15%", SystemEnv.getHtmlLabelName(15378,user.getLanguage()), "status");
			table.addCol("15%", SystemEnv.getHtmlLabelName(20095,user.getLanguage()), "days");
			table.addCol("20%", "出差事由", "days");
		%>
		<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
		<wea:SplitPageTag isShowTopInfo="false" tableString='<%=table.toString()%>' mode="run" />
		<%if("1".equals(isDialog)){ %>
			</div>
			<div id="zDialog_div_bottom" class="zDialog_div_bottom">
				<wea:layout type="2col">
					<wea:group context="">
						<wea:item type="toolbar">
							<input type="button" value="<%=SystemEnv.getHtmlLabelName(309,user.getLanguage())%>" class="e8_btn_cancel" onclick="dialog.close();">
						</wea:item>
					</wea:group>
				</wea:layout>
			</div>
			<script type="text/javascript">jQuery(document).ready(function(){resizeDialog(document);});</script>
		<%} %>
		<iframe name="excels" id="excels" src="" style="display:none" ></iframe>
	</body>
</html>
